const mysql = require('mysql');

//1.创建连接对象
let connection = mysql.createConnection({
    host:'localhost',
    user:'root',
    password:'root',
    port:'3306',
    database:'1705b-userlist'
})

// 2.连接

connection.connect((error) => {
    if(error){
        console.log('连接失败')
    }else{
        console.log('连接成功')
    }
})

module.exports = connection;